import { createRouter, createWebHistory } from 'vue-router';
// createWebHashHistory
import type { RouteRecordRaw } from 'vue-router';

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    redirect: '/main',
  },
  {
    path: '/main',
    name: 'main',
    component: () => import('@/views/main.vue'),
  },
]

const base = import.meta.env['VITE_APP_PUBLIC_PATH'];

const router = createRouter({
  history: createWebHistory(base),
  routes,
})

router.beforeEach((_to, _from, next) => {
  next();
})

export default router
